export default {
	data() {
		return {
			tableHeight: 300,
			loading: false, // 表格加载中
			topHeight: 60,
		}
	},
	mounted() {
		this.getHeight();
		window.onresize = () => {
			this.getHeight();
		}
	},
	updated() {
		if (this.$refs.table) {
			this.$refs.table.doLayout();
		}
	},
	methods: {
		getHeight() {
			window.fullHeight = document.documentElement.clientHeight
			this.$nextTick(() => {
				var table = this.$refs.table && (this.$refs.table.$el || this.$refs.table) || {}
				var pagination = this.$refs.pagination && (this.$refs.pagination.$el || this.$refs.pagination) || {}
				var tableHeight = table.offsetTop || 0
				var paginationHeight = pagination.offsetHeight || 0;
				this.tableHeight = window.fullHeight - tableHeight - paginationHeight - this.topHeight;
			})
		},
	}
}